package com.wkbb.common.enums;

/**
 * @author yangdaofang
 * 创建时间：2020-02-24 16:19
 */
public enum AttStatusEnum {
    //0：正常考勤，1：无权限考勤，2：非访问时段考勤，3：温度异常考勤， 4,访客正常通行考勤 5,访客异常考勤（非通行时段、未登记）)
    NORMAL_TRAFFIC(0,"正常通行"),
    NO_ACCESS(1,"无权限考勤"),
    NON_TRAFFIC_PERIOD(2,"非访问时段考勤"),
    THE_TEMPERATURE_ABNORMAL(3,"温度异常考勤"),
    VISITOR_TRAFFIC(4,"访客正常通行考勤"),
    VISITOR__ABNORMAL(5,"访客异常考勤");

    private Integer code;
    private String desc;

    AttStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 普通方法
    public static String getDesc(short code) {
        for (AttStatusEnum c : AttStatusEnum.values()) {
            if (c.getCode() == code) {
                return c.desc;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
